package com.ruoyi.new2.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.new2.mapper.ExArticleNewMapper;
import com.ruoyi.new2.domain.ExArticleNew;
import com.ruoyi.new2.service.IExArticleNewService;

/**
 * 文章新Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class ExArticleNewServiceImpl implements IExArticleNewService 
{
    @Autowired
    private ExArticleNewMapper exArticleNewMapper;

    /**
     * 查询文章新
     * 
     * @param id 文章新主键
     * @return 文章新
     */
    @Override
    public ExArticleNew selectExArticleNewById(Long id)
    {
        return exArticleNewMapper.selectExArticleNewById(id);
    }

    /**
     * 查询文章新列表
     * 
     * @param exArticleNew 文章新
     * @return 文章新
     */
    @Override
    public List<ExArticleNew> selectExArticleNewList(ExArticleNew exArticleNew)
    {
        return exArticleNewMapper.selectExArticleNewList(exArticleNew);
    }

    /**
     * 新增文章新
     * 
     * @param exArticleNew 文章新
     * @return 结果
     */
    @Override
    public int insertExArticleNew(ExArticleNew exArticleNew)
    {
        exArticleNew.setCreateTime(DateUtils.getNowDate());
        return exArticleNewMapper.insertExArticleNew(exArticleNew);
    }

    /**
     * 修改文章新
     * 
     * @param exArticleNew 文章新
     * @return 结果
     */
    @Override
    public int updateExArticleNew(ExArticleNew exArticleNew)
    {
        exArticleNew.setUpdateTime(DateUtils.getNowDate());
        return exArticleNewMapper.updateExArticleNew(exArticleNew);
    }

    /**
     * 批量删除文章新
     * 
     * @param ids 需要删除的文章新主键
     * @return 结果
     */
    @Override
    public int deleteExArticleNewByIds(Long[] ids)
    {
        return exArticleNewMapper.deleteExArticleNewByIds(ids);
    }

    /**
     * 删除文章新信息
     * 
     * @param id 文章新主键
     * @return 结果
     */
    @Override
    public int deleteExArticleNewById(Long id)
    {
        return exArticleNewMapper.deleteExArticleNewById(id);
    }
}
